import { IN_CREMENT, DE_CREMENT } from '../actions/type'
export default function (state = { count: 0 }, action) {

    // 判断传进来的是什么动作来执行相应的行为
    switch (action.type) {
        case IN_CREMENT:
            state.count++;
            break;
        case DE_CREMENT:
            state.count--;
            break;
        default:
        // return state
    }
    console.log(state, action);
    return { ...state }
}